﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Guest.Master" AutoEventWireup="true" CodeBehind="MakeTeam.aspx.cs" Inherits="ScrumLite.WebUx.ProjectsViews.MakeTeam" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        <%=ViewData.ProjectName%></h1>
        <hr />
    <h2>
        Make Team</h2>
    <form action="<%=Url.Action( new { Controller="Projects", Action="AddPerson", projectId = ViewData.ProjectId })%>" method="post">
    <br />
	<div class="actions">
	<a href="javascript:void(0);" onclick="javascript:document.forms[0].submit();">Add</a>&nbsp;
	<%=Html.ActionLink("Cancel", new { Controller="Projects", Action="Team", projectId = ViewData.ProjectId }) %>&nbsp;
	</div>
	<br />
	
        
        <br />
        
        <table>
        <tr>
        <td valign="top">
            <label for="requestor">
                Employee&nbsp;&nbsp;</label><br />
                <select name="personId">
                <%
                    foreach (var person in ViewData.People)
                    {
                 %>
                 <option value="<%=person.Id %>"><%=person.Name %></option>
                 <%
                    }
                  %>
                </select>
        </td>
        <td valign="top">
            <label for="requestor">
                Status&nbsp;&nbsp;</label><br />
                    <input type="radio" checked name="inOut" value="0" /> Internal &nbsp;&nbsp;<br />
                    <input type="radio" name="inOut" value="1" /> External
        </td>
        <td valign="top">
            <label for="requestor">
                Role(s)&nbsp;&nbsp;</label><br />
                    <select multiple name="roleIds">
                    <%
                        foreach (var role in ViewData.Roles)
                        {
                     %>
                     <option value="<%= role.Id %>"><%= role.Name%></option>
                     <%
                        }
                      %>
                    </select>
        </td>
        </tr>
        </table>
		
    <br />
	    <div class="formTable">
        <table cellspacing="0">
            <tr>
                <th>
                    Employee
                </th>
                <th>
                    Internal/External
                </th>
                <th>
                    Roles
                </th>
                <th>
                Actions
                </th>
            </tr>

            <% 
                if (ViewData.Team != null)
                foreach (var personassignation in ViewData.Team)
               { %>
            <tr>
                <td valign="top">
                <%= personassignation.Person.Name %>
                </td>
                <td valign="top">
                <%
                    if (personassignation.IsInternal)
                        Response.Write("Internal");
                    else
                        Response.Write("External");
                 %>
                </td>
                <td valign="top">
                <%
                    if (personassignation.Roles!=null)
                        foreach (var role in personassignation.Roles)
                        {
                 %>
                 <%= role.Name %><br />
                 <%
                    }
                  %>
                </td>
                <td valign="top">
                    <%=Html.ActionLink("Remove Person", new { Controller="Projects", Action="RemovePerson", projectId = ViewData.ProjectId, PersonId = personassignation.Person.Id.ToString()}) %>
                </td>
            </tr>
            <%
                } %>
            
            
        </table>
    </div>    
    
    <br />
    
	<div class="actions">
	<a href="javascript:void(0);" onclick="javascript:document.forms[0].submit();">Add</a>&nbsp;
	<%=Html.ActionLink("Cancel", new { Controller="Projects", Action="Team", projectId = ViewData.ProjectId }) %>&nbsp;
	</div>
    </form>
    <br />
</asp:Content>
